package com.itheima.spring.config;

import com.itheima.spring.factory.StudentFactoryBean;
import com.itheima.spring.test.A;
import com.itheima.spring.test.B;
import com.itheima.spring.test.Dao;
import com.itheima.spring.test.UseAB;
import com.itheima.spring.test.impl.AImpl;
import com.itheima.spring.test.impl.BImpl;
import com.itheima.spring.test.impl.DaoImpl;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

/**
 * @author ：sean
 * @date ：Created in 2020/6/19
 * @description ：
 * @version: 1.0
 */
@EnableAspectJAutoProxy
@Configuration
@ComponentScan("com.itheima.spring")
public class HmConfig {


	@Bean
	public StudentFactoryBean student(){
		StudentFactoryBean studentFactoryBean = new StudentFactoryBean();
		studentFactoryBean.setStudentInfo("张三,25,366期");
		return studentFactoryBean;
	}

	//@Bean
	//public Dao dao(){
	//	return new DaoImpl();
	//}
	//@Bean
	//public A a(){
	//	System.out.println("构造A");
	//	return new AImpl(dao());
	//}
	//@Bean
	//public B b(){
	//	System.out.println("构造B");
	//	return new BImpl(dao());
	//}
	//
	//@Bean
	//public UseAB useAB(){
	//	UseAB  useAB = new UseAB();
	//	return useAB;
	//}

}
